Skip to content

Conversation

perepichai
Copy link
Contributor

No description provided.

@javascript-translate-bot javascript-translate-bot added the review needed Review needed, please approve or request changes label Jul 11, 2019
@javascript-translate-bot javascript-translate-bot requested a review from a team July 11, 2019 19:43
Copy link
Member

@xcurveballx xcurveballx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Также в папке еще есть для перевода пара заданий к главе

@javascript-translate-bot javascript-translate-bot added changes requested Waiting for changes and /done from PR author and removed review needed Review needed, please approve or request changes labels Jul 11, 2019
@javascript-translate-bot
Copy link
Contributor

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@iliakan iliakan added review needed Review needed, please approve or request changes and removed changes requested Waiting for changes and /done from PR author labels Jul 16, 2019
@iliakan iliakan requested a review from xcurveballx July 16, 2019 06:27
@perepichai
Copy link
Contributor Author

/done

@javascript-translate-bot javascript-translate-bot requested a review from a team July 16, 2019 10:18
@perepichai
Copy link
Contributor Author

Также в папке еще есть для перевода пара заданий к главе

Вижу одно только задание, перевод отправил.

Copy link
Member

@xcurveballx xcurveballx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

еще есть пара англ. слов в 1-form-autosave/solution.view/index.html

@javascript-translate-bot javascript-translate-bot added changes requested Waiting for changes and /done from PR author and removed review needed Review needed, please approve or request changes labels Jul 16, 2019
@javascript-translate-bot
Copy link
Contributor

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@javascript-translate-bot javascript-translate-bot removed the changes requested Waiting for changes and /done from PR author label Jul 16, 2019
@javascript-translate-bot javascript-translate-bot added the needs +1 One more review needed label Jul 16, 2019
@perepichai
Copy link
Contributor Author

/done

@javascript-translate-bot javascript-translate-bot added the review needed Review needed, please approve or request changes label Jul 16, 2019
@javascript-translate-bot javascript-translate-bot requested a review from a team July 16, 2019 13:30
Copy link
Member

@iliakan iliakan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Спасибо! Внеси, пожалуйста, изменения.

Когда пользователь закроет страницу и потом откроет ее заново он должен увидеть последнее введенное значение.

Like this:
Например:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот пример:

Объекты веб-хранилища `localStorage` и `sessionStorage` позволяют хранить пары ключ/значение в браузере.

What's interesting about them is that the data survives a page refresh (for `sessionStorage`) and even a full browser restart (for `localStorage`). We'll see that very soon.
Что в них важно - данные, которые в них записаны, сохраняются после обновления страницы (в случае sessionStorage) и даже после перезапуска браузера (при использовании localStorage). Скоро мы это увидим.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что в них важно - данные, которые в них записаны, сохраняются после обновления страницы (в случае sessionStorage) и даже после перезапуска браузера (при использовании localStorage). Скоро мы это увидим.

- Unlike cookies, web storage objects are not sent to server with each request. Because of that, we can store much more. Most browsers allow at least 2 megabytes of data (or more) and have settings to configure that.
- Also unlike cookies, the server can't manipulate storage objects via HTTP headers. Everything's done in JavaScript.
- The storage is bound to the origin (domain/protocol/port triplet). That is, different protocols or subdomains infer different storage objects, they can't access data from each other.
- В отличие от кук, объекты веб-хранилища не отправляются на сервер при каждом запросе. Поэтому мы можем хранить гораздо больше данных. Большинство браузеров могут сохранить как минимум 2 мегабайта данных (или больше), и этот размер можно поменять в настройках.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кук -> куки

- `length` -- количество элементов в хранилище.

As you can see, it's like a `Map` collection (`setItem/getItem/removeItem`), but also keeps elements order and allows to access by index with `key(index)`.
Как вы видите, интерфейс похож на `Map` (`setItem/getItem/removeItem`), но также запоминается порядок элементов, и можно получить доступ к элементу по индексу -- `key(index)`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как видим, интерфейс похож на Map (setItem/getItem/removeItem), но также запоминается порядок элементов, и можно получить доступ к элементу по индексу -- key(index).

```

That's allowed for historical reasons, and mostly works, but generally not recommended for two reasons:
Это возможно по историческим причинам и, как правило, работает, но обычно не рекомендуется по двум причинам:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это возможно по историческим причинам и, как правило, работает, но обычно не рекомендуется, потому что:

Обратите внимание, что событие также содержит: `event.url` - url-адрес документа, в котором данные обновились.

Also, `event.storageArea` contains the storage object -- the event is the same for both `sessionStorage` and `localStorage`, so `storageArea` references the one that was modified. We may even want to set something back in it, to "respond" to a change.
Также `event.storageArea` содержит объект хранилища - событие одно и то же для `sessionStorage` и `localStorage`, поэтому `storageArea` ссылается на то хранилище, которое было изменено. Мы можем захотеть что-то записать в ответ на изменения.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Также event.storageArea содержит объект хранилища - событие одно и то же для sessionStorage и localStorage, поэтому event.storageArea ссылается на то хранилище, которое было изменено. Мы можем захотеть что-то записать в ответ на изменения.

Объекты веб-хранилища `localStorage` и `sessionStorage` позволяют хранить пары ключ/значение в браузере.
- `key` и `value` должны быть строками.
- Лимит 2 Мб+, зависит от браузера.
- Данные могут храниться неограниченное время.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Данные не имеют "времени истечения".

- `key(index)` -- получить ключ на заданной позиции.
- `length` -- количество элементов в хранилище.
- Используйте `Object.keys` для получения всех ключей.
- Можно использовать ключи в качестве свойств объекта, в этом случае событие `storage` не срабатывает.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Можно обращаться к ключам как к обычным свойствам объекта, в этом случае событие storage не срабатывает.

- Contains all the data about the operation, the document `url` and the storage object.
- Triggers on all `window` objects that have access to the storage except the one that generated it (within a tab for `sessionStorage`, globally for `localStorage`).
- Срабатывает при вызове `setItem`, `removeItem`, `clear`.
- Содержит все данные об операции, `url` документа и объект хранилища.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Содержит все данные об произошедшем обновлении (key/oldValue/newValue), url документа и объект хранилища storageArea.

- Triggers on all `window` objects that have access to the storage except the one that generated it (within a tab for `sessionStorage`, globally for `localStorage`).
- Срабатывает при вызове `setItem`, `removeItem`, `clear`.
- Содержит все данные об операции, `url` документа и объект хранилища.
- Срабатывает на всех объектах `window`, которые имеют доступ к хранилищу, а также там, где оно было сгенерировано (на вкладке для `sessionStorage`, глобально для `localStorage`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Срабатывает на всех объектах window, которые имеют доступ к хранилищу, кроме того, где оно было сгенерировано (внутри вкладки для sessionStorage, глобально для localStorage).

@javascript-translate-bot javascript-translate-bot removed the review needed Review needed, please approve or request changes label Jul 16, 2019
@javascript-translate-bot
Copy link
Contributor

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@javascript-translate-bot javascript-translate-bot added the changes requested Waiting for changes and /done from PR author label Jul 16, 2019
@perepichai
Copy link
Contributor Author

/done

@javascript-translate-bot javascript-translate-bot added review needed Review needed, please approve or request changes and removed changes requested Waiting for changes and /done from PR author labels Jul 16, 2019
@javascript-translate-bot javascript-translate-bot requested a review from a team July 16, 2019 16:06
@iliakan
Copy link
Member

iliakan commented Jul 16, 2019

🚀

@javascript-translate-bot javascript-translate-bot merged commit d6f6847 into javascript-tutorial:master Jul 16, 2019
@perepichai
Copy link
Contributor Author

Парни, большое спасибо за терпение! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs +1 One more review needed review needed Review needed, please approve or request changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants